<template>
  <el-table
    :data="tableData"
    stripe
    style="width: 100%"
    size="large"
    :header-cell-style="{
      background: '#b2b7c680',
      color: '#606266',
      height: '50px',
    }"
  >
    <el-table-column align="center" prop="xitype" label="席位类别" />
    <el-table-column align="center" prop="chenum" label="车厢数">
      <template #default="scope"
        ><el-input-number
          v-model="scope.row.chenum"
          :min="1"
          @change="handleChange"
      /></template>
    </el-table-column>
    <el-table-column align="center" prop="chepai" label="每车排数">
      <template #default="scope"
        ><el-input-number
          v-model="scope.row.chepai"
          :min="1"
          @change="handleChange1"
      /></template>
    </el-table-column>
    <el-table-column align="center" prop="chexi" label="每车席位" />
    <el-table-column align="center" prop="xiannum" label="每车限乘人数">
      <template #default="scope"
        ><el-input-number
          v-model="scope.row.cheren"
          :min="1"
          @change="handleChange2"
      /></template>
    </el-table-column>
    <el-table-column align="center" prop="chewu" label="每车无座数" />
  </el-table>
</template>

<script setup lang="ts">
const handleChange = (value: number) => {
  console.log(value);
};
const handleChange1 = (value: number) => {
  console.log(value);
};
const handleChange2 = (value: number) => {
  console.log(value);
};
const tableData = [
  {
    xitype: "商务座",
    chenum: 1,
    chepai: 1,
    cheren: 17,
    chexi: 24,
    chewu: "",
  },
  {
    xitype: "一等座",
    chenum: 1,
    chepai: 1,
    cheren: 17,
    chexi: 24,
    chewu: "",
  },
  {
    xitype: "二等座",
    chenum: 1,
    chepai: 1,
    cheren: 17,
    chexi: 24,
    chewu: 10,
  },
  {
    xitype: "软卧",
    chenum: 1,
    chepai: 1,
    cheren: 17,
    chexi: 24,
    chewu: "",
  },
  {
    xitype: "硬卧",
    chenum: 1,
    chepai: 1,
    cheren: 17,
    chexi: 24,
    chewu: "",
  },
  {
    xitype: "硬座",
    chenum: 1,
    chepai: 1,
    cheren: 17,
    chexi: 24,
    chewu: 10,
  },
];
</script>
